package ar.edu.itba.tp1.gps.board;

import java.util.List;

public class Bucket {

	private List<Coordinate> groupCells;
	private Integer groupResult;
	private Operators operator;

	public Bucket(Integer groupResult, List<Coordinate> groupCells, Operators operator) {
		this.groupResult = groupResult;
		this.groupCells = groupCells;
		this.operator = operator;
	}
	
	public List<Coordinate> getGroupCells() {
		return groupCells;
	}
	
	public void setGroupCells(List<Coordinate> groupCells) {
		this.groupCells = groupCells;
	}
	
	public Integer getGroupResult() {
		return groupResult;
	}

	public Operators getOperator() {
		return operator;
	}

	public void setOperator(Operators operator) {
		this.operator = operator;
	}

	public void setGroupResult(Integer groupResult) {
		this.groupResult = groupResult;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((groupCells == null) ? 0 : groupCells.hashCode());
		result = prime * result
				+ ((groupResult == null) ? 0 : groupResult.hashCode());
		result = prime * result
				+ ((operator == null) ? 0 : operator.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Bucket other = (Bucket) obj;
		if (groupCells == null) {
			if (other.groupCells != null)
				return false;
		} else if (!groupCells.equals(other.groupCells))
			return false;
		if (groupResult == null) {
			if (other.groupResult != null)
				return false;
		} else if (!groupResult.equals(other.groupResult))
			return false;
		if (operator != other.operator)
			return false;
		return true;
	}
	
}
